package com.hut.oa.model.bean;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * 物品申请的物品列表
 * @author 朱嘉茵
 *
 */
@Entity
@Table(name="apply_object_list")
public class ApplyObjectList {
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="aoo_id")	
	private Long id;//物品id
	
	@Column(name="aoo_name",nullable=false)
	private String name;//物品名称
	
	@Column(name="aoo_unit",nullable=false)
	private String unit;//物品单位
	
	@Column(name="aoo_count",nullable=false)
	private Integer count;//物品数量
	
	@Column(name="aoo_remark",nullable=false)
	private String remark;//备注
	
	@JsonIgnore
	@JoinColumn(name="aoo_ao_id",nullable=false)
	@ManyToOne(cascade=CascadeType.PERSIST,fetch=FetchType.LAZY)
	private ApplyObject applyObject;//物品申请表

	public ApplyObjectList() {}
	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getUnit() {
		return unit;
	}

	public void setUnit(String unit) {
		this.unit = unit;
	}

	public Integer getCount() {
		return count;
	}

	public void setCount(Integer count) {
		this.count = count;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}
	

	public ApplyObject getApplyObject() {
		return applyObject;
	}

	public void setApplyObject(ApplyObject applyObject) {
		this.applyObject = applyObject;
	}

	@Override
	public String toString() {
		return "ApplyObjectObject [id=" + id + ", name=" + name + ", unit=" + unit + ", count=" + count + ", remark="
				+ remark + "]";
	}
	
}
